//
//  NetworkTools.h
//  我的微博
//
//  Created by tom-1 on 15/12/8.
//  Copyright © 2015年 tom-1. All rights reserved.
//


#import <AFNetworking/AFNetworking.h>

// 网络请求枚举
typedef enum : NSUInteger {
    GET,
    POST,
} TomRequestMethod;

@interface NetworkTools : AFHTTPSessionManager

// 应用程序的信息
//@property (nonatomic ,copy) NSString *appKey;
//@property (nonatomic,copy) NSString *appSecret;
//@property (nonatomic,copy) NSString *redirectURL;

// OAuth 授权 URL
@property (nonatomic,strong) NSURL *oauthURL;

+ (instancetype)sharedTools;
- (void)request: (TomRequestMethod)method URLString: (NSString *)URLString parameters: (id)parameters finished: (void (^)(id result, NSError *error))finished;

// 加载AccessToken
- (void)loadAccessToken: (NSString *)code finished: (void (^)(id result, NSError *error))finished;

// 用户相关方法
- (void)loadUserInfo: (NSString *)uid accessToken: (NSString *)accessToken finished: (void (^)(id result, NSError *error))finished;

@end
